package com.example.designPattern.singleton;



//线程安全的
public class BadmashSafeSingleton {
    private static BadmashSafeSingleton instance;
    private BadmashSafeSingleton(){
    }
    public synchronized static BadmashSafeSingleton getInstance(){
        if(instance==null)instance=new BadmashSafeSingleton();
        return instance;
    }
}
